package com.ibm.risk.irmp.workflow.client.flowable.api;

import com.ibm.risk.irmp.workflow.client.flowable.ApiClient;

import com.ibm.risk.irmp.workflow.client.flowable.model.CaseDefinitionActionRequest;
import com.ibm.risk.irmp.workflow.client.flowable.model.CaseDefinitionResponse;
import com.ibm.risk.irmp.workflow.client.flowable.model.CmmnModel;
import com.ibm.risk.irmp.workflow.client.flowable.model.DataResponseCaseDefinitionResponse;
import com.ibm.risk.irmp.workflow.client.flowable.model.DmnDecisionTable;
import com.ibm.risk.irmp.workflow.client.flowable.model.RestIdentityLink;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.util.UriComponentsBuilder;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;


@Component("com.ibm.risk.irmp.flowable.api.CaseDefinitionsApi")
public class CaseDefinitionsApi {
    private ApiClient apiClient;

    public CaseDefinitionsApi() {
        this(new ApiClient());
    }

    @Autowired
    public CaseDefinitionsApi(ApiClient apiClient) {
        this.apiClient = apiClient;
    }

    public ApiClient getApiClient() {
        return apiClient;
    }

    public void setApiClient(ApiClient apiClient) {
        this.apiClient = apiClient;
    }

    /**
     * Add a candidate starter to a case definition
     * It is possible to add either a user or a group.
     * <p><b>200</b> - successful operation
     * <p><b>201</b> - Indicates the case definition was found and the identity link was created.
     * <p><b>400</b> - Indicates the body does not contain the correct information.
     * <p><b>404</b> - Indicates the requested case definition was not found.
     * @param caseDefinitionId The caseDefinitionId parameter
     * @param body The body parameter
     * @return RestIdentityLink
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public RestIdentityLink createIdentityLink(String caseDefinitionId, RestIdentityLink body) throws RestClientException {
        Object postBody = body;

        // verify the required parameter 'caseDefinitionId' is set
        if (caseDefinitionId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'caseDefinitionId' when calling createIdentityLink");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("caseDefinitionId", caseDefinitionId);
        String path = UriComponentsBuilder.fromPath("/cmmn-repository/case-definitions/{caseDefinitionId}/identitylinks").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = {
            "application/json"
        };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<RestIdentityLink> returnType = new ParameterizedTypeReference<RestIdentityLink>() {};
        return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * Delete a candidate starter from a case definition
     *
     * <p><b>204</b> - Indicates the case definition was found and the identity link was removed. The response body is intentionally empty.
     * <p><b>404</b> - Indicates the requested case definition was not found or the case definition does not have an identity-link that matches the url.
     * @param caseDefinitionId The caseDefinitionId parameter
     * @param family The family parameter
     * @param identityId The identityId parameter
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public void deleteIdentityLink(String caseDefinitionId, String family, String identityId) throws RestClientException {
        Object postBody = null;

        // verify the required parameter 'caseDefinitionId' is set
        if (caseDefinitionId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'caseDefinitionId' when calling deleteIdentityLink");
        }

        // verify the required parameter 'family' is set
        if (family == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'family' when calling deleteIdentityLink");
        }

        // verify the required parameter 'identityId' is set
        if (identityId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'identityId' when calling deleteIdentityLink");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("caseDefinitionId", caseDefinitionId);
        uriVariables.put("family", family);
        uriVariables.put("identityId", identityId);
        String path = UriComponentsBuilder.fromPath("/cmmn-repository/case-definitions/{caseDefinitionId}/identitylinks/{family}/{identityId}").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = { };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
        apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * Execute actions for a case definition
     * Execute actions for a case definition (Update category)
     * <p><b>200</b> - Indicates action has been executed for the specified process. (category altered)
     * <p><b>400</b> - Indicates no category was defined in the request body.
     * <p><b>404</b> - Indicates the requested case definition was not found.
     * @param caseDefinitionId The caseDefinitionId parameter
     * @param body The body parameter
     * @return CaseDefinitionResponse
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public CaseDefinitionResponse executeCaseDefinitionAction(String caseDefinitionId, CaseDefinitionActionRequest body) throws RestClientException {
        Object postBody = body;

        // verify the required parameter 'caseDefinitionId' is set
        if (caseDefinitionId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'caseDefinitionId' when calling executeCaseDefinitionAction");
        }

        // verify the required parameter 'body' is set
        if (body == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling executeCaseDefinitionAction");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("caseDefinitionId", caseDefinitionId);
        String path = UriComponentsBuilder.fromPath("/cmmn-repository/case-definitions/{caseDefinitionId}").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = {
            "application/json"
        };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<CaseDefinitionResponse> returnType = new ParameterizedTypeReference<CaseDefinitionResponse>() {};
        return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * Get a case definition
     *
     * <p><b>200</b> - Indicates request was successful and the case definitions are returned
     * <p><b>404</b> - Indicates the requested case definition was not found.
     * @param caseDefinitionId The caseDefinitionId parameter
     * @return CaseDefinitionResponse
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public CaseDefinitionResponse getCaseDefinition(String caseDefinitionId) throws RestClientException {
        Object postBody = null;

        // verify the required parameter 'caseDefinitionId' is set
        if (caseDefinitionId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'caseDefinitionId' when calling getCaseDefinition");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("caseDefinitionId", caseDefinitionId);
        String path = UriComponentsBuilder.fromPath("/cmmn-repository/case-definitions/{caseDefinitionId}").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = {
            "application/json"
        };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<CaseDefinitionResponse> returnType = new ParameterizedTypeReference<CaseDefinitionResponse>() {};
        return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * Get a case definition CMMN model
     *
     * <p><b>200</b> - Indicates the process definition was found and the model is returned. The response contains the full process definition model.
     * <p><b>404</b> - Indicates the requested process definition was not found.
     * @param caseDefinitionId The caseDefinitionId parameter
     * @return CmmnModel
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public CmmnModel getCmmnModelResource(String caseDefinitionId) throws RestClientException {
        Object postBody = null;

        // verify the required parameter 'caseDefinitionId' is set
        if (caseDefinitionId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'caseDefinitionId' when calling getCmmnModelResource");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("caseDefinitionId", caseDefinitionId);
        String path = UriComponentsBuilder.fromPath("/cmmn-repository/case-definitions/{caseDefinitionId}/model").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = {
            "application/json"
        };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<CmmnModel> returnType = new ParameterizedTypeReference<CmmnModel>() {};
        return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * Get a candidate starter from a case definition
     *
     * <p><b>200</b> - Indicates the case definition was found and the identity link was returned.
     * <p><b>404</b> - Indicates the requested case definition was not found or the case definition does not have an identity-link that matches the url.
     * @param caseDefinitionId The caseDefinitionId parameter
     * @param family The family parameter
     * @param identityId The identityId parameter
     * @return RestIdentityLink
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public RestIdentityLink getIdentityLink(String caseDefinitionId, String family, String identityId) throws RestClientException {
        Object postBody = null;

        // verify the required parameter 'caseDefinitionId' is set
        if (caseDefinitionId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'caseDefinitionId' when calling getIdentityLink");
        }

        // verify the required parameter 'family' is set
        if (family == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'family' when calling getIdentityLink");
        }

        // verify the required parameter 'identityId' is set
        if (identityId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'identityId' when calling getIdentityLink");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("caseDefinitionId", caseDefinitionId);
        uriVariables.put("family", family);
        uriVariables.put("identityId", identityId);
        String path = UriComponentsBuilder.fromPath("/cmmn-repository/case-definitions/{caseDefinitionId}/identitylinks/{family}/{identityId}").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = {
            "application/json"
        };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<RestIdentityLink> returnType = new ParameterizedTypeReference<RestIdentityLink>() {};
        return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * Get a case definition image
     *
     * <p><b>200</b> - Indicates request was successful and the case definitions are returned
     * <p><b>404</b> - Indicates the requested case definition was not found.
     * @param caseDefinitionId The caseDefinitionId parameter
     * @return List&lt;byte[]&gt;
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public List<byte[]> getImageResource(String caseDefinitionId) throws RestClientException {
        Object postBody = null;

        // verify the required parameter 'caseDefinitionId' is set
        if (caseDefinitionId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'caseDefinitionId' when calling getImageResource");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("caseDefinitionId", caseDefinitionId);
        String path = UriComponentsBuilder.fromPath("/cmmn-repository/case-definitions/{caseDefinitionId}/image").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = {
            "image/png"
        };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<List<byte[]>> returnType = new ParameterizedTypeReference<List<byte[]>>() {};
        return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * Get a case definition resource content
     *
     * <p><b>200</b> - Indicates both case definition and resource have been found and the resource data has been returned.
     * <p><b>404</b> - Indicates the requested case definition was not found or there is no resource with the given id present in the case definition. The status-description contains additional information.
     * @param caseDefinitionId The caseDefinitionId parameter
     * @return List&lt;byte[]&gt;
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public List<byte[]> getProcessDefinitionResource(String caseDefinitionId) throws RestClientException {
        Object postBody = null;

        // verify the required parameter 'caseDefinitionId' is set
        if (caseDefinitionId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'caseDefinitionId' when calling getProcessDefinitionResource");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("caseDefinitionId", caseDefinitionId);
        String path = UriComponentsBuilder.fromPath("/cmmn-repository/case-definitions/{caseDefinitionId}/resourcedata").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = { };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<List<byte[]>> returnType = new ParameterizedTypeReference<List<byte[]>>() {};
        return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * Get a case definition start form
     *
     * <p><b>200</b> - Indicates request was successful and the case definition form is returned
     * <p><b>404</b> - Indicates the requested case definition was not found.
     * @param caseDefinitionId The caseDefinitionId parameter
     * @return String
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public String getProcessDefinitionStartForm(String caseDefinitionId) throws RestClientException {
        Object postBody = null;

        // verify the required parameter 'caseDefinitionId' is set
        if (caseDefinitionId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'caseDefinitionId' when calling getProcessDefinitionStartForm");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("caseDefinitionId", caseDefinitionId);
        String path = UriComponentsBuilder.fromPath("/cmmn-repository/case-definitions/{caseDefinitionId}/start-form").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = {
            "application/json"
        };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<String> returnType = new ParameterizedTypeReference<String>() {};
        return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * List decision tables for a case definition
     *
     * <p><b>200</b> - Indicates the case definition was found and the decision tables are returned.
     * <p><b>404</b> - Indicates the requested case definition was not found.
     * @param caseDefinitionId The caseDefinitionId parameter
     * @return List&lt;DmnDecisionTable&gt;
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public List<DmnDecisionTable> listCaseDefinitionDecisionTables(String caseDefinitionId) throws RestClientException {
        Object postBody = null;

        // verify the required parameter 'caseDefinitionId' is set
        if (caseDefinitionId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'caseDefinitionId' when calling listCaseDefinitionDecisionTables");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("caseDefinitionId", caseDefinitionId);
        String path = UriComponentsBuilder.fromPath("/cmmn-repository/case-definitions/{caseDefinitionId}/decision-tables").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = {
            "application/json"
        };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<List<DmnDecisionTable>> returnType = new ParameterizedTypeReference<List<DmnDecisionTable>>() {};
        return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * List candidate starters for a case definition
     *
     * <p><b>200</b> - Indicates the case definition was found and the requested identity links are returned.
     * <p><b>404</b> - Indicates the requested case definition was not found.
     * @param caseDefinitionId The caseDefinitionId parameter
     * @return List&lt;RestIdentityLink&gt;
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public List<RestIdentityLink> listCaseDefinitionIdentityLinks(String caseDefinitionId) throws RestClientException {
        Object postBody = null;

        // verify the required parameter 'caseDefinitionId' is set
        if (caseDefinitionId == null) {
            throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'caseDefinitionId' when calling listCaseDefinitionIdentityLinks");
        }

        // create path and map variables
        final Map<String, Object> uriVariables = new HashMap<String, Object>();
        uriVariables.put("caseDefinitionId", caseDefinitionId);
        String path = UriComponentsBuilder.fromPath("/cmmn-repository/case-definitions/{caseDefinitionId}/identitylinks").buildAndExpand(uriVariables).toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        final String[] accepts = {
            "application/json"
        };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<List<RestIdentityLink>> returnType = new ParameterizedTypeReference<List<RestIdentityLink>>() {};
        return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
    /**
     * List of case definitions
     *
     * <p><b>200</b> - Indicates request was successful and the case definitions are returned
     * <p><b>400</b> - Indicates a parameter was passed in the wrong format or that latest is used with other parameters other than key and keyLike. The status-message contains additional information.
     * @param version Only return case definitions with the given version.
     * @param name Only return case definitions with the given name.
     * @param nameLike Only return case definitions with a name like the given name.
     * @param key Only return case definitions with the given key.
     * @param keyLike Only return case definitions with a name like the given key.
     * @param resourceName Only return case definitions with the given resource name.
     * @param resourceNameLike Only return case definitions with a name like the given resource name.
     * @param category Only return case definitions with the given category.
     * @param categoryLike Only return case definitions with a category like the given name.
     * @param categoryNotEquals Only return case definitions which do not have the given category.
     * @param deploymentId Only return case definitions with the given category.
     * @param startableByUser Only return case definitions which are part of a deployment with the given id.
     * @param latest Only return the latest case definition versions. Can only be used together with key and keyLike parameters, using any other parameter will result in a 400-response.
     * @param suspended If true, only returns case definitions which are suspended. If false, only active process definitions (which are not suspended) are returned.
     * @param sort Property to sort on, to be used together with the order.
     * @return DataResponseCaseDefinitionResponse
     * @throws RestClientException if an error occurs while attempting to invoke the API
     */
    public DataResponseCaseDefinitionResponse listCaseDefinitions(Integer version, String name, String nameLike, String key, String keyLike, String resourceName, String resourceNameLike, String category, String categoryLike, String categoryNotEquals, String deploymentId, String startableByUser, Boolean latest, Boolean suspended, String sort) throws RestClientException {
        Object postBody = null;

        String path = UriComponentsBuilder.fromPath("/cmmn-repository/case-definitions").build().toUriString();

        final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
        final HttpHeaders headerParams = new HttpHeaders();
        final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();

        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "version", version));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "name", name));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "nameLike", nameLike));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "key", key));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "keyLike", keyLike));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "resourceName", resourceName));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "resourceNameLike", resourceNameLike));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "category", category));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "categoryLike", categoryLike));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "categoryNotEquals", categoryNotEquals));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "deploymentId", deploymentId));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "startableByUser", startableByUser));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "latest", latest));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "suspended", suspended));
        queryParams.putAll(apiClient.parameterToMultiValueMap(null, "sort", sort));

        final String[] accepts = {
            "application/json"
        };
        final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
        final String[] contentTypes = { };
        final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);

        String[] authNames = new String[] { "basicAuth" };

        ParameterizedTypeReference<DataResponseCaseDefinitionResponse> returnType = new ParameterizedTypeReference<DataResponseCaseDefinitionResponse>() {};
        return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
    }
}
